<?php
namespace app\admin\validate;

/**
 * 文章验证
 */
class Article extends Main
{
    protected $rule = [
        'cover_img' => 'require',
        'title' => 'require',
        'desc' => 'require',
        'category_id' =>'require'
    ];

    protected $message = [
        'cover_img.require' => '请上传封面图',
        'title.require' => '请填写标题',
        'desc.require' => '请填写内容',
        'category_id.require' => '请选择文章分类'
    ];

    protected $scene = [
        'add' =>  ['cover_img', 'title', 'desc', 'category_id'],
        'edit' => ['cover_img', 'title', 'desc', 'category_id'],
        'del' => ['id']
    ];
}